package com.jmp.util;

import org.apache.commons.lang3.StringUtils;

/**
 * @author cjr
 */
public class GoodsUtils {
    public static String formatDetail(String detail) {
        if (detail.contains("w100p\" style=\"display: flex;\" ")) {
            return detail;
        }

        if (!StringUtils.contains(detail, "w100p")) {
            detail = StringUtils.replaceAll(detail, "<img ", "<img class=\"w100p\" ");
        }
        if (StringUtils.contains(detail, " style=\"\"")) {
            detail = StringUtils.replaceAll(detail, "style=\"\"", "style=\"display: flex;\"");
        } else {
            detail = StringUtils.replaceAll(detail, "w100p\" ", "w100p\" style=\"display: flex;\" ");
        }
        return detail;
    }
}
